struct Solution {}

impl Solution {
  pub fn add_digits(num: i32) -> i32 {
      if num < 10 {
          return num; 
      }
      return (num - 10) % 9 + 1;
  }
}